Method of extracting feature of input image based on example pyramid, and facial recognition apparatus

ABSTRACT

At least one example embodiment discloses a method of extracting a feature of an input image. The method includes constructing an example pyramid including at least one hierarchical level based on stored example images, generating a codebook in each of the at least one hierarchical level, calculating a similarity between the codebook and the input image, and extracting a feature of the input image based on the similarity.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Korean PatentApplication No. 10-2014-0122796, filed on Sep. 16, 2014, in the KoreanIntellectual Property Office, the disclosure of which is incorporatedherein by reference in its entirety.

BACKGROUND

1. Field

At least some example embodiments relate to a method of extracting afeature of an input image based on an example pyramid and a facialrecognition apparatus.

2. Description of the Related Art

Recently, an importance of security has been increasing in variousfields including, for example, banking, security, or technicalinformation protection. Accordingly, an increasing number of securitycameras have been installed, and a type and amount of images stored in asecurity image archive are also increasing. By conducting a search ofthe security image archive, an incident may be prevented or a type ofcrime and a criminal may be detected in an event of the incident.However, rapidly completing such a search of the security image archivein which images acquired from numerous cameras are stored is difficult.

SUMMARY

Accordingly, there is a desire for a search method of recognizing afeature of an image to acquire a desired image of a situation from amongimages stored in a high capacity archive. In general, in a stored image,facial recognition performance may be degraded in response to changes ina posture, lighting, or an expression and thus, product application maynot be commonly available.

At least one example embodiment relates to a method of extracting afeature of an input image.

According to an example embodiment, a method of extracting a feature ofan input image includes constructing a example pyramid including atleast one hierarchical level based on stored example images, generatinga codebook included in each of the at least one hierarchical level,calculating a similarity between the codebook and the input image, andextracting a feature of the input image based on the similarity.

At least some example embodiments provide the constructing may includegenerating example image groups for each of the at least onehierarchical level by clustering the example images based on areference, and constructing the example pyramid based on the exampleimage groups.

At least some example embodiments provide that the generating theexample image groups may include projecting a feature vector of theexample images to a feature space, and generating the example imagegroups for each of the at least one hierarchical level by clustering thefeature vector based on a distance in the feature space.

At least some example embodiments provide that the generating thecodebook may include generating a plurality of visual words based onexample image groups included in each of the at least one hierarchicallevel, and generating the codebook based on the visual words.

At least some example embodiments provide that the generating the visualwords may include performing vector quantization on the example imagegroups included in each of the at least one hierarchical level, andgenerating the visual words based on the vector quantization.

At least some example embodiments provide that the generating the visualwords may include performing sparse coding on the example image groupsincluded in each of the at least one hierarchical level, and generatingthe visual words based on the sparse coding.

At least some example embodiments provide that the calculating mayinclude measuring distances between the input image and a plurality ofgroups associated with visual words included in the codebook in afeature space, and calculating the similarity based on the measureddistances.

At least some example embodiments provide that the method may furtherinclude concatenating the measured distances.

At least some example embodiments provide that the extracting mayinclude extracting the feature of the input image based on adistribution of a probability value with respect to the similarity.

At least some example embodiments provide that the extracting mayinclude assigning a weight to the distribution of the probability value,and extracting the feature of the input image based on the weight.

At least one example embodiment relates to a facial recognitionapparatus.

According to an example embodiment, a facial recognition apparatusincludes a face extractor configured to extract a facial area from aninput image, a normalizer configured to perform normalization on thefacial area, a feature extractor configured to extract a feature of theinput image based on the normalized facial area and a stored codebook,and a recognizer configured to recognize a face based on the extractedfeature, wherein the codebook is based on example image groups includedin each level of a example pyramid using stored example images.

At least some example embodiments provide that the feature extractor maybe configured to calculate a similarity between the normalized facialarea and the codebook, and extract the feature of the input image basedon the similarity.

At least some example embodiments provide that the feature extractor maybe configured to measure distances between the normalized facial areaand a plurality of groups associated with visual words included in thecodebook in a feature space, and calculate the similarity based on themeasured distances.

At least some example embodiments provide that the feature extractor maybe configured to assign a weight to a distribution of a probabilityvalue with respect to the similarity, and extract the feature of theinput image based on the weight.

At least some example embodiments provide that the recognizer may beconfigured to recognize a face using a classifier based on the extractedfeature.

At least some example embodiments provide that the apparatus may furtherinclude a codebook generator configured to construct the example pyramidincluding at least one hierarchical level based on the stored exampleimages, and generate the codebook for an example image groups includedin each of the at least one hierarchical level.

At least some example embodiments provide that the codebook generatormay be configured to project a feature vector of the stored exampleimages onto a feature space, generate the example image groups for eachof the at least one hierarchical level by clustering the feature vectorbased on a distance in the feature space, and construct the examplepyramid based on the example image groups.

At least some example embodiments provide that the codebook generatormay be configured to generate a plurality of visual words based on theexample image groups included and generate the codebook based on thevisual words.

At least some example embodiments provide that the codebook generatormay be configured to perform vector quantization on the example imagegroups included and generate the visual words based on the vectorquantization.

Additional aspects of example embodiments will be set forth in part inthe description which follows and, in part, will be apparent from thedescription, or may be learned by practice of the disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

These and/or other aspects will become apparent and more readilyappreciated from the following description of example embodiments, takenin conjunction with the accompanying drawings of which:

FIG. 1 illustrates an example of a codebook generation method accordingto at least one example embodiment;

FIG. 2 illustrates an example of an example pyramid constructed based ona method of extracting a feature of an input image according to at leastone example embodiment;

FIG. 3 illustrates an example of constructing an example pyramid in amethod of extracting a feature of an input image according to at leastone example embodiment;

FIG. 4 illustrates an example of a codebook generation method in amethod of extracting a feature of an input image according to at leastone example embodiment;

FIG. 5 illustrates an example of an example pyramid constructed based ona method of extracting a feature of an input image and an example ofexample image groups included in each level of the example pyramidaccording to at least one example embodiment;

FIG. 6 illustrates a method of extracting a feature of an input imageaccording to at least one example embodiment;

FIG. 7 illustrates an example of extracting a feature of an input imagebased on a method of extracting a feature of an input image according toat least one example embodiment;

FIG. 8 illustrates an example of a result obtained by readjusting adistance-based feature based on a recognition priority by using a methodof extracting a feature of an input image according to at least oneexample embodiment;

FIG. 9 illustrates an example of a method of calculating a similaritybetween an input image and a codebook based on a method of extracting afeature of an input image according to at least one example embodiment;and

FIG. 10 illustrates an example of a facial recognition apparatusaccording to at least one example embodiment.

DETAILED DESCRIPTION

A computer system may be used as a reference to explain exampleembodiments described below. It will be sufficiently understood by thoseskilled in the art that systems and methods described below may beapplicable to a display system including a user interface. Inparticular, a user authentication method and apparatus based on a facialrecognition provided in the present disclosure may be implemented by acomputer system including at least one processor, a memory, and adisplay device. As known by those skilled in the art, the computersystem may be, for example, a portable device such as a cellular phoneand the like.

As used herein, the terms “embodiment,” “example,” “aspect,” and“instance” should not be interpreted to mean that a certain aspect ordesign is superior to or advantageous compared to another aspect ofdesign.

As used in this application, the terms “component”, “module”, “system”and “interface” are intended to refer to a computer-related entity, forexample, either hardware, a combination of hardware and software,software, or software in execution.

As used herein, the term “or” is intended to mean an inclusive “or”rather than an exclusive “or.” That is, unless specified otherwise, orclear from context, “X uses A or B” is intended to mean any of thenatural inclusive permutations.

Moreover, articles “a” and “an” as used in the subject specification andannexed drawings should generally be construed to mean “at least one”unless specified otherwise or clear from context to be directed to asingular form.

It will be understood that, as used herein, the term “and/or,” includesany and all combinations of one or more of the associated listed items.

It will be further understood that the terms “comprises,” “comprising,”“includes,” and/or “including,” when used herein, specify the presenceof stated features, integers, steps, operations, elements, and/orcomponents, but do not preclude the presence or addition of one or moreother features, integers, steps, operations, elements, components,and/or groups thereof.

Hereinafter, example embodiments will be described in detail withreference to the accompanying drawings. However, it should be understoodthat example embodiments are not construed as limited thereto. Likereference numerals in the drawings denote like elements.

In the following description, an input image may be explained based on aface image as an example. However, an image of a body part unique foreach user may also be used as the input image.

FIG. 1 illustrates an example of a codebook generation method accordingto at least one example embodiment.

Referring to FIG. 1, in operation 110, an apparatus for extracting afeature of an input image according to at least one example embodimentconstructs an example pyramid (example pyramid) including at least onehierarchical level based on pre-stored example images. Hereinafter, theapparatus for extracting a feature of an input image may also bereferred to as an extracting apparatus.

In operation 110, the extracting apparatus may generate example imagegroups for each of the at least one hierarchical level by clustering theexample images based on a predetermined and/or selected reference.

The extracting apparatus may project a feature vector of the exampleimages to a feature space, and generate the example image groups byclustering the feature vector based on a distance in the feature space.The example image groups may be generated for each of the at least onehierarchical level. The extracting apparatus may generate a singleexample image group as well as a plurality of example image groups.

The extracting apparatus may construct the example pyramid using exampleimage groups. An example of the example pyramid constructed according toat least one example embodiment is illustrated in FIG. 2.

In operation 130, the extracting apparatus generates a codebook for theexample image groups included in each of the at least one hierarchicallevel. In operation 130, the extracting apparatus may form a pluralityof sets having similar features based on the example image groupsincluded in each of the at least one hierarchical level, generate aplurality of visual words for each of the sets and then, generate thecodebook based on the visual words.

In this example, the visual words may be small patches of an image or apixel array transferring information of interest, for example, a colorchange and a texture change, in a predetermined and/or selected featurespace.

The extracting apparatus may perform vector quantization on the exampleimage groups included in each of the at least one hierarchical level,and generate the visual words based on a result of the vectorquantization.

In an example, the extracting apparatus may perform sparse coding on theexample image groups included in each of the at least one hierarchicallevel, and generate the visual words based on a result of the sparsecoding.

The codebook generated in operations 110 and 130 may be stored in adatabase or a memory. A process of generating the codebook based onoperations 110 and 130 may be performed through learning in advance.Thus, the process of generating the codebook may also be referred to asa learning procedure. Hereinafter, descriptions about the process ofgenerating the codebook will be provided with reference to FIGS. 2through 5.

FIG. 2 illustrates an example of an example pyramid constructed based ona method of extracting a feature of an input image according to at leastone example embodiment.

FIG. 2 illustrates an example pyramid including a hierarchical level.

In an example, the example pyramid may be constructed by classifyingpre-stored example images based on a distance in a feature space. Inthis example, the example images may include face images of userscorresponding to race, age, and gender.

The extracting apparatus may project a feature vector to the featurespace, and generate example image groups by clustering the featurevector based on a distance in the feature space. By adjusting a level ofthe example pyramid, the extracting apparatus may extend or optimize thefeature vector such that an input image is adjusted based on asituation.

In the example pyramid of FIG. 2, one example image group 210 may begenerated in a first level, two example image groups 220 and 230 may begenerated in a second level, and four example image groups 240, 250,260, and 270 may be generated in a third level.

In this example, the example image groups 240, 250, 260, and 270 of thethird level may correspond to groups obtained by classifying the exampleimage groups 220 and 230 of the second level for each feature based on apredetermined and/or selected reference.

An extracting apparatus may generate a codebook 215 for the exampleimage group 210 in the first level, and may generate codebooks 225 and235 for the example image groups 220 and 230, respectively. Theextracting apparatus may generate codebooks 245, 255, 265, and 275 forthe example image groups 240, 250, 260, and 270 in the third level,respectively.

In an example, an individual codebook may be generated for eachclustered example image group. Each of the codebooks 215, 225, 235, 245,255, 265, and 275 may include a plurality of visual words.

In an example, information on a distance between an input image and eachof example images may be used as a feature, and a codebook may begenerated by classifying the example images for each feature. Throughthis, detailed features may be extracted from the input image.

FIG. 3 illustrates an example of constructing an example pyramid in amethod of extracting a feature of an input image according to at leastone example embodiment.

Referring to FIG. 3, example image groups 310 and 330 include aplurality of example images. Also, the example image groups 310 and 330include anchor images 315 and 335, respectively. In this example, eachof the anchor images 315 and 335 may be an average image of elementsconfiguring a corresponding group, and technically indicate an averageof a plurality of clusters.

Due to intra and extra facial variations, example images may beclustered into the example image groups 310 and 330 in a feature space.

An individual face image may have a different distance measured from theexample images. In an example, the distance may be used as a feature ofthe face image.

In the feature space, for example, a distance between female face imagesmay be less than a distance between a female face image and a male faceimage, and a distance between male face images may be less than thedistance between the female face image and the male face image. Thus,the female face images and the male face images may be clustered intocorresponding clusters, respectively. In each cluster, distances betweenthe anchor images 315 and 335 and other images may be used as featuresof faces images included in the corresponding cluster.

FIG. 4 illustrates a learning procedure for generating a codebook in amethod of extracting a feature of an input image according to at leastone example embodiment.

Referring to FIG. 4, in operation 410, an extracting apparatus generatesexample image groups for each hierarchical level by clustering exampleimages based on a predetermined and/or selected reference.

In operation 420, the extracting apparatus performs vector quantizationon the example image groups in each hierarchical level.

In operation 430, the extracting apparatus generates a plurality ofvisual words based on a result of the vector quantization performed inoperation 420. Depending on an example, the extracting apparatus mayperform sparse coding on the example image groups in each hierarchicallevel, and generate a plurality of visual words based on a result of thesparse coding.

In operation 440, the extracting apparatus generates a codebook based onthe plurality of visual words generated in operation 430. As illustratedin FIG. 5, the codebook may be generated for each level of an examplepyramid, and for each example image group included in the each level.

FIG. 5 illustrates an example pyramid constructed based on a method ofextracting a feature of an input image and example image groups includedin each level of the example pyramid according to at least one exampleembodiment.

Referring to FIG. 5, the example pyramid may have three levels.

A codebook C₁ generated at a level 1 of the example pyramid maycorrespond to, for example, an average face image obtained by averagingdistances among all example images in a feature space.

At a level 2, the extracting apparatus may generate two example imagegroups by segmenting the distances averaged at the level 1. In thisexample, one example image group may be an example image group clusteredbased on a male face, and another example image group may be an exampleimage group clustered based on a female face.

The extracting apparatus may generate a codebook C₂₁ using a pluralityof visual words corresponding to a common feature of the example imagegroup clustered based on the male face. Also, the extracting apparatusmay generate a codebook C₂₂ using a plurality of visual wordscorresponding to a common feature of the example image group clusteredbased on the female face.

At a level 3, the extracting apparatus may generate four new exampleimage groups by segmenting the example image groups clustered at thelevel 2.

In this example, two of the new example image groups may be obtained bysegmenting the example image group clustered based on the male face, andtwo of the other new example image groups may be obtained by segmentingthe example image group clustered based on the female face.

The extracting apparatus may segment distances among example images inthe example image group clustered based on the male face, therebygenerating example image groups clustered based on a young male face andan old male face, respectively.

The extracting apparatus may generate a codebook C₃₁ for the exampleimage group clustered based on the old male face, and generate acodebook C₃₂ for the example image group clustered based on the youngmale face.

The extracting apparatus may segment distances among example images inthe example image group clustered based on the female face, therebygenerating example image groups clustered based on a young female faceand an old female face, respectively.

The extracting apparatus may generate a codebook C₃₃ for the exampleimage group clustered based on the old female face, and generate acodebook C₃₄ for the example image group clustered based on the youngfemale face.

In an example, as a level of an example pyramid increases, example imagegroups generated for each level may represent more detailed features,for example, a male and a female, a light complexion and a darkcomplexion, and an old man and a young man. Since the example imagegroups represent more detailed features according to an increase in thehierarchical level of the example pyramid or descending to a lower levelof the example pyramid, a desired feature may be extracted through anextension or an optimization by adjusting the hierarchical level of theexample pyramid.

FIG. 6 illustrates a method of extracting a feature of an input imageaccording to at least one example embodiment.

Referring to FIG. 6, in operation 610, an extracting apparatuscalculates a similarity between an input image and a codebook.

The extracting apparatus may measure a distance between the input imageand each of a plurality of visual words included in the codebook in afeature space, and calculate the similarity based on the measureddistance. The extracting apparatus may measure the distance between theinput image and each of the visual words included in the codebook in thefeature space using, for example, an L2 distance, which is a Euclideandistance formula.

The extracting apparatus may measure the distance between the inputimage and each of the visual words projected onto the feature spacebased on a feature extracted from the input image.

In operation 630, the extracting apparatus extracts the feature of theinput image based on the similarity calculate in operation 610. Theextracting apparatus may extract the feature of the input image based ona distribution of a probability value with respect to the calculatedsimilarity, or extract the feature of the input image based on a resultof assigning a weight to the distribution of the probability value.Operations 610 and 630 may also be referred to as a feature extractionprocedure.

FIG. 7 illustrates a feature extraction procedure for extracting afeature of an input image in a method of extracting a feature of aninput image according to at least one example embodiment.

Referring to FIG. 7, in operation 710, an extracting apparatuscalculates distances between an input image and a plurality of visualwords included in a codebook in a feature space. The codebook may relateto example image groups included in each level, and may be provided insingle and plural forms. The extracting apparatus may calculate asimilarity between the input image and the codebook based on thecalculated distances. In this example the extracting apparatus mayextract a feature of the input image based on a distribution of aprobability value with respect to the similarity calculated in operation710.

The distribution, for example, u_(ij), of the probability value withrespect to the similarity may be expressed by Equation 1.

$\begin{matrix}{u_{ij} = \frac{\exp \left( {{- \beta}{{x_{i} - b_{j}}}_{2}^{2}} \right)}{\sum\limits_{k = 1}^{n}{\exp \left( {{- \beta}{{x_{i} - b_{k}}}_{2}^{2}} \right)}}} & \left\lbrack {{Equation}\mspace{14mu} 1} \right\rbrack\end{matrix}$

In Equation 1, β denotes a weight, x_(i) denotes the input image, b_(j)denotes an example image, b_(k) and denotes a total sum of exampleimages.

In operation 720, the extracting apparatus concatenates the distancesbetween the visual words and the input image calculated in operation 710after normalization of the input image.

In operation 730, for a local smooth sparsity, the extracting apparatusreadjusts a feature or a feature value based on the calculated distancesby analyzing an influence of single-feature elements on a recognitionresult, for example, the distances between the input image and thevisual words concatenated in operation 720, in order of a recognitionpriority.

Descriptions with respect to a result of readjusting the distance-basedfeature based on the recognition priority using the extracting apparatuswill be provided with reference to a graph of FIG. 8.

Depending on an example, the extracting apparatus may cut-off adissimilar codebook response such as a locality-constrained linearcoding (LLC), based on the distribution of the probability value withrespect to the similarity calculated in operation 710, therebyextracting the feature of the input image.

Also, for a local smoothness, the extracting apparatus may assign theweight to the distribution of the probability value, thereby extractingthe feature of the input image. Subsequently, the extracting apparatusmay perform facial recognition using a recognizer such as a supportvector machine (SVM).

FIG. 8 is a graph illustrating a result obtained by readjusting adistance-based feature based on a recognition priority by using a methodof extracting a feature of an input image according to at least oneexample embodiment.

A result of readjusting a feature element value based on a beta valuemay be indicated with reference to FIG. 8. In the graph of FIG. 8, anx-axis represents the beta value, and a y-axis represents a function(x).In this example, the function(x) may be exp(−beta*x.̂2). Also, thecorresponding function may be used to correct a distance value based ona probability value and correct a variation and a range of the correcteddistance value. The beta value may be a parameter for correcting achange in a value.

Also, an x-input may be a distance value between an example image and aninput image, and a y-output may be a value resulting from a correctionof a change in the distance value based on the beta value.

When the beta value is relatively large, the extracting apparatus mayamplify a feature element disposed in a short distance while a featureelement disposed in a long distance is close to “0”. However, an inverseresult may be obtained when the beta value is relatively small.

In FIG. 8, when an x-value is relatively small, a feature element may bedisposed at a short distance. Conversely, when the x-value is relativelylarge, the feature element may be disposed at a long distance.

FIG. 9 illustrates an example of a method of calculating a similaritybetween an input image and a codebook based on a method of extracting afeature of an input image according to example embodiments.

An input image 910 and seven codebooks 920, 930, 940, 950, 960, 970, and980 for example image groups included in each level may be indicatedwith reference to FIG. 9.

Each of the seven codebooks 920, 930, 940, 950, 960, 970, and 980 mayinclude five different visual words, and an extracting apparatus maycalculate distances between the input image 910 and the visual wordsincluded in each of the seven codebooks 920, 930, 940, 950, 960, 970,and 980.

The extracting apparatus may concatenate the distances between the inputimage 910 and the visual words included in each of the seven codebooks920, 930, 940, 950, 960, 970, and 980 into a single feature afternormalization of the input image 910.

FIG. 10 illustrates an example of a facial recognition apparatusaccording to at least one example embodiment.

Referring to FIG. 10, an extracting apparatus 1000 includes a faceextractor 1010, a normalizer 1020, a feature extractor 1030, and arecognizer 1040. Also, the extracting apparatus 1000 may further includea codebook generator 1050.

The extracting apparatus 1000 may be the extracting apparatus describedin any of the previous embodiments.

The extracting apparatus 1000 may be hardware, firmware, hardwareexecuting software or any combination thereof. When the extractingapparatus 1000 is hardware, such existing hardware may include one ormore Central Processing Units (CPUs), digital signal processors (DSPs),application-specific-integrated-circuits (ASICs), field programmablegate arrays (FPGAs) or the like configured as special purpose machinesto perform the functions of the face extractor 1010, the normalizer1020, the feature extractor 1030, the recognizer 1040 and the codebookgenerator 1050. CPUs, DSPs, ASICs and FPGAs may generally be referred toas processing devices.

In the event where the extracting apparatus 1000 is a processorexecuting software, the processor is configured as a special purposemachine to execute the software, stored in a storage medium, to performthe functions of the face extractor 1010, the normalizer 1020, thefeature extractor 1030, the recognizer 1040 and the codebook generator1050. In such an embodiment, the processor may include one or moreCentral Processing Units (CPUs), digital signal processors (DSPs),application-specific-integrated-circuits (ASICs), field programmablegate arrays (FPGAs).

The face extractor 1010 may extract a facial area from an input image.

The normalizer 1020 may perform normalization on the facial areaextracted by the face extractor 1010.

The feature extractor 1030 may extract a feature of the input imagebased on a pre-stored codebook and the facial area normalized by thenormalizer 1020. In this example, the codebook may be obtained based onexample image groups included in each level of an example pyramidconstructed based on pre-stored example images.

The codebook may be stored in, for example, the codebook generator 1050,in advance.

The feature extractor 1030 may calculate a similarity between thenormalized facial area and the codebook, and extract the feature of theinput image based on the calculated similarity.

The feature extractor 1030 may measure distances between the normalizedfacial area and a plurality of visual words included in the codebook,and calculated the similarity based on the measured distances.

The feature extractor 1030 may assign a weight to a distribution of aprobability value with respect to the calculated similarity, and extractthe feature of the input image based on the weight.

The recognizer 1040 may recognize a face based on the feature extractedby the feature extractor 1030.

The recognizer 1040 may recognize the face using a classifier based onthe feature extracted by the feature extractor 1030.

The codebook generator 1050 may construct an example pyramid includingat least one hierarchical level based on the pre-stored example images.The codebook generator 1050 may generate a codebook for example imagegroups included in each of the at least one hierarchical level.

The codebook generator 1050 may project a feature vector of the exampleimages onto a feature space, and generate the example image groups foreach of the at least one hierarchical level by clustering the featurevector of the example images based on a distance in the feature space.The codebook generator 1050 may construct the example pyramid using theexample image groups.

The codebook generator 1050 may generate a plurality of visual wordsbased on the example image groups included in each of the at least onehierarchical level, and generate the codebook based on the visual words.

The codebook generator 1050 may perform vector quantization on theexample image groups included in each of the at least one hierarchicallevel, and generate the visual words based on a result of the vectorquantization.

The methods according to the above-described example embodiments may berecorded in non-transitory computer-readable media including programinstructions to implement various operations of the above-describedexample embodiments. The media may also include, alone or in combinationwith the program instructions, data files, data structures, and thelike. The program instructions recorded on the media may be thosespecially designed and constructed for the purposes of exampleembodiments, or they may be of the kind well-known and available tothose having skill in the computer software arts. Examples ofnon-transitory computer-readable media include magnetic media such ashard disks, floppy disks, and magnetic tape; optical media such asCD-ROM discs, DVDs, and/or Blue-ray discs; magneto-optical media such asoptical discs; and hardware devices that are specially configured tostore and perform program instructions, such as read-only memory (ROM),random access memory (RAM), flash memory (e.g., USB flash drives, memorycards, memory sticks, etc.), and the like. Examples of programinstructions include both machine code, such as produced by a compiler,and files containing higher level code that may be executed by thecomputer using an interpreter. The above-described devices may beconfigured to act as one or more software modules in order to performthe operations of the above-described example embodiments, or viceversa.

A number of examples have been described above. Nevertheless, it shouldbe understood that various modifications may be made. For example,suitable results may be achieved if the described techniques areperformed in a different order and/or if components in a describedsystem, architecture, device, or circuit are combined in a differentmanner and/or replaced or supplemented by other components or theirequivalents. Accordingly, other implementations are within the scope ofthe following claims.

What is claimed is:
 1. A method of extracting a feature of an inputimage, the method comprising: constructing a example pyramid includingat least one hierarchical level based on stored example images;generating a codebook in each of the at least one hierarchical level;calculating a similarity between the codebook and the input image; andextracting a feature of the input image based on the similarity.
 2. Themethod of claim 1, wherein the constructing comprises: generatingexample image groups for each of the at least one hierarchical level byclustering the example images based on a reference; and constructing theexample pyramid based on the example image groups.
 3. The method ofclaim 2, wherein the generating the example image groups comprises:projecting a feature vector of the example images to a feature space;and generating the example image groups for each of the at least onehierarchical level by clustering the feature vector based on a distancein the feature space.
 4. The method of claim 1, wherein the generatingthe codebook comprises: generating a plurality of visual words based onexample image groups in each of the at least one hierarchical level; andgenerating the codebook based on the visual words.
 5. The method ofclaim 4, wherein the generating the visual words comprises: performingvector quantization on the example image groups in each of the at leastone hierarchical level; and generating the visual words based on thevector quantization.
 6. The method of claim 4, wherein the generatingthe visual words comprises: performing sparse coding on the exampleimage groups in each of the at least one hierarchical level; andgenerating the visual words based on the sparse coding.
 7. The method ofclaim 1, wherein the calculating comprises: measuring distances betweenthe input image and a plurality of groups associated with visual wordsin the codebook in a feature space; and calculating the similarity basedon the measured distances.
 8. The method of claim 7, further comprising:concatenating the measured distances.
 9. The method of claim 1, whereinthe extracting comprises: extracting the feature of the input imagebased on a distribution of a probability value with respect to thesimilarity.
 10. The method of claim 9, wherein the extracting comprises:assigning a weight to the distribution of the probability value; andextracting the feature of the input image based on the weight.
 11. Anon-transitory computer-readable medium comprising program code that,when executed by a processor, causes the processor to perform the methodof claim
 1. 12. A facial recognition apparatus comprising: a faceextractor configured to extract a facial area from an input image; anormalizer configured to perform normalization on the facial area; afeature extractor configured to extract a feature of the input imagebased on the normalized facial area and a stored codebook; and arecognizer configured to recognize a face based on the extractedfeature, wherein the codebook is based on example image groups in eachlevel of a example pyramid using stored example images.
 13. Theapparatus of claim 12, wherein the feature extractor is configured tocalculate a similarity between the normalized facial area and thecodebook, and extract the feature of the input image based on thesimilarity.
 14. The apparatus of claim 13, wherein the feature extractoris configured to measure distances between the normalized facial areaand a plurality of groups associated with visual words in the codebookin a feature space, and calculate the similarity based on the measureddistances.
 15. The apparatus of claim 14, wherein the feature extractoris configured to assign a weight to a distribution of a probabilityvalue with respect to the similarity, and extract the feature of theinput image based on the weight.
 16. The apparatus of claim 12, whereinthe recognizer is configured to recognize a face using a classifierbased on the extracted feature.
 17. The apparatus of claim 12, furthercomprising: a codebook generator configured to construct the examplepyramid including at least one hierarchical level based on the storedexample images, and generate the codebook for example image groups ineach of the at least one hierarchical level.
 18. The apparatus of claim17, wherein the codebook generator is configured to project a featurevector of the stored example images onto a feature space, generate theexample image groups for each of the at least one hierarchical level byclustering the feature vector based on a distance in the feature space,and construct the example pyramid based on the example image groups. 19.The apparatus of claim 17, wherein the codebook generator is configuredto generate a plurality of visual words based on the example imagegroups and generate the codebook based on the visual words.
 20. Theapparatus of claim 19, wherein the codebook generator is configured toperform vector quantization on the example image groups and generate thevisual words based on the vector quantization.